package com.wutao.panzh.admin.content.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.panzh.UtilEntity.ResultVO;
import com.panzh.entity.HotelSaleAttr;
import com.panzh.myconst.CommonConst;
import com.wutao.panzh.service.HotelSaleAttrService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class HotelSaleAttrController {

    @Reference
    private HotelSaleAttrService hotelSaleAttrService;

    @RequestMapping("get/all/sale/attr")
    @ResponseBody
    public ResultVO getAllSaleAttr(){
        List<HotelSaleAttr> hotelSaleAttrs = hotelSaleAttrService.getAllSaleAttr();
        if (hotelSaleAttrs == null || hotelSaleAttrs.size() == 0){
            return new ResultVO<String>(ResultVO.FAILED, CommonConst.INFORMATION_DOES_NOT_EXIST, ResultVO.NO_DATA);
        }
        return new ResultVO<List<HotelSaleAttr>>(ResultVO.SUCCESS,ResultVO.NO_MSG , hotelSaleAttrs);
    }
}
